import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import echarts from 'echarts'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import { Loading } from 'element-ui';
import './rem'
import VideoPlayer from 'vue-video-player'
import'video.js/dist/video-js.css'
import'vue-video-player/src/custom-theme.css'

import { DropdownMenu, DropdownItem , Picker ,Cell ,List ,Swipe,SwipeItem} from 'vant';
import 'vant/lib/index.css';
Vue.use(Picker);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Cell);
Vue.use(SwipeItem);
Vue.use(Swipe);
Vue.use(List);
Vue.use(VideoPlayer);

Vue.use(ViewUI);
Vue.use(Loading.directive)
Vue.prototype.$echarts = echarts
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
  // 对响应数据做点什么
  if(response.status!=1){
    // Vue.message.warning('登录超时')
    // toLogin(response.data.message)
  }
  return response;
})


router.beforeEach((to, from , next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next();
})


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
